package appapi.controller.updata;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * @version: java version 1.8
 * @Author: Ygp Work
 * @description:  解析线上版本号
 * @date: 2023-08-04 16:42
 */
public class FileUtils {
    public static String findFileInfo(String directory, String filename) {
        StringBuilder fileContent = new StringBuilder();
        BufferedReader reader = null;

        try {
            File file = new File(directory, filename);
            reader = new BufferedReader(new FileReader(file));

            String line;
            while ((line = reader.readLine()) != null) {
                fileContent.append(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        return fileContent.toString();
    }
}